home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / rexx / printuserlist.clrexx < prev    next >
Encoding:
Text File  |  1995-11-26  |  2.2 KB  |  71 lines

  1. /*
  2. **  $VER: PrintUserList.clrexx 1.0 (22 Nov 1995)
  3. **
  4. **        © 1995 Ralf Ramge
  5. **
  6. **  PROGRAMNAME:
  7. **      PrintUserList.clrexx
  8. **
  9. **  FUNCTION:
  10. **      Gibt eine Liste der User mit Priorität, Realname, Anschrift und
  11. **      Telefonnummer auf dem Drucker aus.
  12. **
  13. */
  14.  
  15. /* cl_rexx.library öffnen */
  16.  
  17. if ~show('L','cl_rexx.library') then do
  18.     if ~addlib('cl_rexx.library',0,-30,0) then do
  19.         address command 'ASSIGN LIBS: CONNECTLINE:Libs ADD'
  20.         if ~addlib('connectline:libs/cl_rexx.library',0,-30,0) then exit 10
  21.         end
  22.     end
  23.  
  24.  
  25. anzahl=CLGET_UserNumberOf()
  26.  
  27. do x=1 to anzahl
  28.     user.x=CLGET_Username(x)
  29.     prio.x=CLGET_UserPriority(user.x)
  30.     if prio.x<10 then prio.x='0'prio.x
  31.     real.x=CLGET_UserRealname(user.x)
  32.     addr.x=CLGET_UserAddress(user.x)
  33.     tele.x=CLGET_UserTelephone(user.x)
  34.     end
  35.  
  36. userbreite=16
  37. priobreite=4
  38. realbreite=20
  39. addrbreite=20
  40. telebreite=18
  41.  
  42. call print(center('Username',userbreite)||center('Pr',priobreite)||center('Realname',realbreite)||center('Adresse',addrbreite)||center('Telefon',telebreite)||'0a'x)
  43. call print(copies('=',userbreite-1) copies('=',priobreite-1) copies('=',realbreite-1) copies('=',addrbreite-1) copies('=',telebreite-1)||'0a'x)
  44.  
  45. do x=1 to anzahl-1
  46.     call print(left(user.x,userbreite)||left(prio.x,priobreite)||left(real.x,realbreite-1)' '||left(addr.x,addrbreite-1)' '||left(tele.x,telebreite)||'0a'x)
  47.     if (length(real.x)>realbreite-1)|(length(addr.x)>addrbreite-1) then do
  48.         call print(copies(' ',userbreite) copies(' ',priobreite-1))
  49.         if length(real.x)<realbreite-1 then call print(copies(' ',realbreite))
  50.         else call print(left(right(real.x,length(real.x)-(realbreite-1)),realbreite-1))
  51.         if length(addr.x)<addrbreite-1 then call print(copies(' ',addrbreite)||'0a'x)
  52.         else call print(left(right(addr.x,length(addr.x)-(addrbreite-1)),addrbreite-1)||'0a'x)
  53.         end
  54.     call print(copies('-',userbreite-1) copies('-',priobreite-1) copies('-',realbreite-1) copies('-',addrbreite-1) copies('-',telebreite-1)||'0a'x)
  55.     end
  56.  
  57. exit
  58.  
  59. /* die eigentliche Druckroutine */
  60.  
  61. print:
  62. parse arg druckzeile
  63. if ~show('F','Printer') then do
  64.     if ~open('Printer','PRT:') then do
  65.         return 'ERROR'
  66.         end
  67.     end
  68. return writech('Printer',druckzeile)
  69.  
  70.  
  71.